package com.aca.impl;

import com.aca.dao.RoleDAO;
import com.aca.entity.Role;
import com.aca.entity.Scene;
import com.aca.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("roleService")
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleDAO roleDao;

    public void setRoleDao(RoleDAO roleDao) {
        this.roleDao = roleDao;
    }

    @Override
    public void addRole(Role role) {
        roleDao.addRole(role);
    }

    @Override
    public void updateRole(Role role) {
        roleDao.updateRole(role);
    }

    @Override
    public void delRole(String name) {
        roleDao.delRole(name);
    }

    @Override
    public Role findRoleByName(String name) {
        return roleDao.findRoleByName(name);
    }

    @Override
    public List findRoleByScene(Scene scene) {
        return roleDao.findRoleByScene(scene);
    }

    @Override
    public List pageRole(int pageCur, int pageSize, Role role) {
        return pageRole(pageCur,pageSize,role);
    }

    @Override
    public int getRoleTol() {
        return roleDao.getRoleTol();
    }

    @Override
    public List findAllRole() {
        return roleDao.findAllRole();
    }

    @Override
    public boolean existRole(String name) {
        return roleDao.existRole(name);
    }
}
